<template>
    <div>
        <h1>新增地址</h1>
        姓名：<input type="text" v-model="name"/><br/>
        区域：<input type="text" v-model="area"/><br/>
        地址：<input type="text" v-model="address"/><br/>
        手机号：<input type="text" v-model="tel"/><br/>
        备注：<input type="text" v-model="tips"/><br/>
        是否默认地址：
        <label><input name="ad" type="radio" v-model="ad" value="1" />是</label>
        <label><input name="ad" type="radio" v-model="ad" value="0" />否</label><br/>
        <button @click="add"><router-link to="">点击添加地址</router-link></button>
    </div>
</template>

<script setup>
import {ref} from 'vue';
import axios from 'axios';

let name=ref('');
let area=ref('');
let address=ref('');
let tel=ref('');
let tips=ref('');
let ad=ref(0);
let add=()=>{
    axios.post('/api/add',{
        name:name.value,
        area:area.value,
        address:address.value,
        tel:tel.value,
        tips:tips.value,
        ad:ad.value
    }).then(res=>{
        console.log(res.data);
    });
};


</script>

<style lang="scss" scoped>


</style>